{% extends "datapanel/base.html" %}
{% load crispy_forms_tags %}
{% block content %}
<div class="d-flex justify-content-center">
<div class="col-md-5 col-lg-4  shadow-lg p-3 my-4 bg-white rounded">
{% if form.errors %}
<p>用户名与密码不匹配，请重试</p>
{% endif %}

{% if next %}
    {% if user.is_authenticated %}
    <p>无权限访问本页面，请登出，更换帐号重试.</p>
    {% else %}
    <p>请登录后再访问.</p>
    {% endif %}
{% endif %}

<form method="post" action="{% url 'datapanel:login' %}">
    {% csrf_token %}
    {{ form|crispy }}
    <input type="submit"  class="btn btn-primary btn-block"  value="登录">
    <input type="hidden" name="next" value="{{ next }}">
 </form>
</div>
</div>
{% endblock %}